﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StyleMVVM.DependencyInjection
{
	/// <summary>
	/// Represents a configuration object for an assembly
	/// </summary>
	public interface IExportAssemblyConfiguration
	{
		/// <summary>
		/// Export all objects that implements the specified interface
		/// </summary>
		/// <param name="interfaceType">interface type</param>
		/// <returns>returns self</returns>
		IExportAssemblyConfiguration ExportInterface(Type interfaceType);

		/// <summary>
		/// Export all types based on speficied type
		/// </summary>
		/// <param name="baseType">base type to export</param>
		/// <returns></returns>
		IExportAssemblyConfiguration ExportTypesBasedOn(Type baseType);

		/// <summary>
		/// Exclude a particular type from exporting
		/// </summary>
		/// <param name="excludeType">exclude type</param>
		/// <returns></returns>
		IExportAssemblyConfiguration Excluding(Type excludeType);

		/// <summary>
		/// Export with the spcified priority
		/// </summary>
		/// <param name="priority">priority to export at</param>
		/// <returns></returns>
		IExportAssemblyConfiguration WithPriority(int priority);

		/// <summary>
		/// Export in the specified Environment
		/// </summary>
		/// <param name="environment">environment to export in</param>
		/// <returns></returns>
		IExportAssemblyConfiguration InEnvironment(ExportEnvironment environment);

		/// <summary>
		/// Exports are to be marked as shared
		/// </summary>
		/// <returns></returns>
		IExportAssemblyConfiguration AndShared();

		/// <summary>
		/// Obsolete infavor of AndSingleton
		/// </summary>
		/// <returns></returns>
		[Obsolete("Obsolete infavor of AndSingleton")]
		IExportAssemblyConfiguration AndSharedPermenantly();

		/// <summary>
		/// Export services as Singletons
		/// </summary>
		/// <returns></returns>
		IExportAssemblyConfiguration AndSingleton();

		/// <summary>
		/// Export all attributed types
		/// </summary>
		/// <returns></returns>
		IExportAssemblyConfiguration ExportAttributedTypes();

		/// <summary>
		/// Marks all exports as Core Exports
		/// </summary>
		/// <param name="startOrder"></param>
		/// <returns></returns>
		IExportAssemblyConfiguration CoreExport(CoreExportStartOrder startOrder);

		/// <summary>
		/// Adds a condition to the export
		/// </summary>
		/// <param name="conditionDelegate"></param>
		IExportAssemblyConfiguration When(ExportConditionDelegate conditionDelegate);

		/// <summary>
		/// Adds a condition to the export
		/// </summary>
		/// <param name="conditionDelegate"></param>
		IExportAssemblyConfiguration Unless(ExportConditionDelegate conditionDelegate);

		/// <summary>
		/// Adds a condition to the export
		/// </summary>
		/// <param name="condition"></param>
		IExportAssemblyConfiguration AndCondition(IExportCondition condition);

		/// <summary>
		/// Gets all known Export Strategies (internal method)
		/// </summary>
		/// <returns></returns>
		IEnumerable<IExportStrategy> GetExportStrategies();
	}
}